package com.authine.cloudpivot.ext.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.authine.cloudpivot.ext.domain.Wgk;
import com.authine.cloudpivot.ext.domain.WgkVo;
import com.authine.cloudpivot.util.MyMapper;

@Mapper
public interface WgkMapper extends MyMapper<Wgk> {

    @Select("SELECT creater FROM `i598n_wgk` group by creater")
    List<String> getCreaters();

    @Select("SELECT count(1) FROM `i598n_wgk` where creater =  #{userId}")
    int getCount(String userId);

    @Select("SELECT id FROM `i598n_wgk` where creater = #{userId}")
    List<String> getWgkIds(String userId);

    int updateCode(@Param(value = "list") List<WgkVo> list);
}